<?php


namespace App\Models\Field;

class ProField extends BaseField
{
    public static function getFormats($scene = self::BASE_INFO): array
    {
        $baseFormats = [
            'id' => static function ($model) {
                return $model['user_id'];
            },
            'avatar',
            'description',
            'nickname',
            'phone' => static function ($model) {
                return empty($model['phone']) ? '' : substr_replace($model['phone'], '****', 3, 4);
            },
        ];

        return $formats[$scene] ?? $baseFormats;
    }
}
